//
//  PBOrderSexCell.m
//  PBHomeDemo
//
//  Created by Playboy on 2018/1/19.
//  Copyright © 2018年 tmkj. All rights reserved.
//

#import "PBOrderSexCell.h"
#import "LQXSwitch.h"

@implementation PBOrderSexCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    [self configure];
}
- (void)configure {
    LQXSwitch *swit = [[LQXSwitch alloc] initWithFrame:CGRectMake(kScreenWidth-70-15, 10, 70, 30) onColor:[UIColor tm_mainOrignColor] offColor:[UIColor tm_mainOrignColor] font:[UIFont systemFontOfSize:12] ballSize:30];
    swit.onText = @"先生";
    swit.offText = @"女士";
    swit.on = YES;
    swit.layer.borderColor = [UIColor tm_mainOrignColor].CGColor;
    swit.layer.borderWidth = 1.0f;
    swit.layer.cornerRadius = 15;
    swit.layer.masksToBounds = YES;
    [self.contentView addSubview:swit];
    [swit addTarget:self action:@selector(switchSex:) forControlEvents:UIControlEventValueChanged];
}

- (void)switchSex:(LQXSwitch *)swit
{
    NSLog(@"%zd",swit.on);
    if (self.delegate && [self.delegate respondsToSelector:@selector(backWithSexType:)]) {
        [self.delegate backWithSexType:swit.on];
    }
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
